Part Number Hot Search : 
UV1316 LT1178C TL1021 10150C 5251B MT1117 F2807S SMCJ300A
Product Description
Full Text Search
 

To Download MGLS-240182 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 1 of 37 mgl(s) - 240128 mgl(s) - 240128 displays displays application note application note prepared for prepared for trident microsystems ltd trident microsystems ltd perrywood business park perrywood business park honeycrock lane honeycrock lane salfords salfords redhill redhill surrey surrey rh1 5jq rh1 5jq by by and software ltd and software ltd 4 forest drive 4 forest drive theydon bois theydon bois essex essex cm16 7ey cm16 7ey
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 2 of 37 contents contents 1. introduction ................................ ................................ ............................ 4 1.1 background ................................ ................................ ............................ 4 1.2 example design ................................ ................................ ....................... 4 1.3 driving the display from a pc ................................ ............................... 4 1.4 glossary of terms and abbreviations ................................ ................ 5 1.5 references ................................ ................................ .............................. 5 2. an overview of the module ................................ ................................ ... 6 2.1 physical components ................................ ................................ ............. 6 2.2 electrical overview ................................ ................................ .............. 6 2.3 settings fixed by hardware pinning in the module ........................... 6 2.4 pin options in the example design ................................ ........................ 7 3. hardware interfacing ................................ ................................ ............ 8 3.1 pin signal explanations ................................ ................................ ......... 8 3.2 typical bus systems ................................ ................................ ............... 9 3.3 the example design ................................ ................................ ................ 10 3.4 wait states ................................ ................................ .............................. 10 3.5 operating voltage ................................ ................................ ................. 10 3.6 recommended power up sequence ................................ ....................... 11 4. modes ................................ ................................ ................................ ........ 11 4.1 what the data sheet means by 'mode' ................................ .................. 11 4.2 pixel combination methods ................................ ................................ ... 12 4.3 pixel combination example - 'or' mode ................................ ................. 13 4.4. character generator ................................ ................................ ........... 13 4.5 limitations of the available pixel combination methods ................. 14 4.6 limitations of 'text attribute' mode ................................ .................... 14 4.7 limitations of graphics based modes ................................ ................... 14 4.8 limitations of all characters displayed from the text area ......... 14 4.9 choosing a pixel combination method ................................ ................. 14
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 3 of 37 5. memory overview ................................ ................................ ................... 15 5.1 text area ................................ ................................ ................................ . 15 5.2 graphics area ................................ ................................ ......................... 15 5.3 font area ................................ ................................ ................................ 16 5.4 suggested memory map ................................ ................................ ......... 16 5.5 ram implications of column configurations ................................ ....... 17 5.6 pin programmable columns ................................ ................................ .. 17 5.7 text area column setting ................................ ................................ ..... 17 5.8 graphics area column setting ................................ .............................. 18 5.9 ram implications of font selections ................................ .................... 19 5.10 graphic bits to pixel mapping when 8 by 8 font selected ............... 19 5.11 graphic bits to pixel mapping when 6 b 8 font selected ................. 20 5.12 memory, columns and font summary ................................ ................ 20 5.13 memory, column and font settings in the example design ............ 2 1 6. command overview ................................ ................................ ................. 21 6.1 commands and data ................................ ................................ ............... 21 6.2 status checking ................................ ................................ ...................... 22 6.3 differing status checks for auto / normal mode .............................. 22 6.4 command and data write order ................................ ........................... 22 6.5 word write order ................................ ................................ .................. 22 6.6 command set summary ................................ ................................ .......... 23 7. hints and tips ................................ ................................ ........................... 23 7.1 usage checklist ................................ ................................ ...................... 23 7.2 hardware action checklist ................................ ................................ .. 23 7.3 software action checklist ................................ ................................ ... 23 7.4 the action sequence in the example design ................................ ....... 24 7.5 troubleshooting basics / check list ................................ .................... 25 8. using other modules ................................ ................................ .............. 27 8.1 module xxxxx ................................ ................................ ......................... 27 8.2 module xxxxx ................................ ................................ ......................... 27 appendix a - sample pc interfacing circuitry appendix b - trial 'c' code appendix c - command list
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 4 of 37 1. 1. introduction introduction 1.1 1.1 background background this application note is to help designers incorporate the mgl(s)-240128 display module into their products. the intention is to supplement rather than replace the existing data sheets for the display module and its toshiba controller. it concentrates on the areas where this existing documentation was found to be weakest. although the toshiba controller data sheets is the main source of technical detail it is inevitably a general description covering all the controller's potential uses and is not specifically targeted for its use in the module in question. it follows that some parts of the data sheet describe the use of the controller in ways which are not possible or appropriate in the finished module. this can make the existing documentation confusing and hard to follow and this application note tries to clear up some of the uncertainty in this area. the information is presented in an informal style with examples, rather than as a fully rigorous treatment. 1.2 1.2 example design example design the information presented is based on the experience of one design team when including the module into a new product, a scientific instrument. in this application the module was used as the main display element, and needed to show: a full screen bit-mapped graphics logo at power up. a variety of menu options, each shown as text framed in a rectangular box. a variety of tabulated results in text but with some items highlighted by being displayed in inverse. titles in a larger font size than the standard. results shown with subscripts (i.e. smaller characters displaced downwards by part line spacing). graphs of results with annotated axes and large font titles. where relevant, for illustration, a brief summary of the options and parameter settings used in this example design are given in each section. 1.3 1.3 driving the display from a pc driving the display from a pc the appendices include details of how to use a low cost proprietary parallel i/o card (code am11m from mps ltd) to drive the module from a pc. for simplicity this is based on using the card's parallel i/o lines to control and drive the data bus rather than connecting it directly to the pc bus. sample 'c' interfacing routines for driving the card to generate some simple displays are also given.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 5 of 37 1.4 1.4 glossary of terms and abbreviations glossary of terms and abbreviations lsb least significant bit or least significant byte mcu microcontroller msb most significant bit or most significant byte ram random access memory (i.e. read/write memory) rom read only memory vdd the nominal 5 volt supply fed to the module vo the operating voltage used to derive the signals which drive the display glass. a relatively large negative voltage (-15->-20 volts) is usually required. the details depend on the fluid used in the module and on temperature. vss the nominal 0 volt supply fed to the module 1.5 1.5 references references the following documents give background information on the module and the toshiba controller on which it is based. reference 1 reference 1 document t6963c data sheet doc. no. - date - version - author - reference 2 reference 2 document varitronix - liquid crystal modules (data sheet / short form catalogue) doc. no. - date 11/96 version - author varitronix
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 6 of 37 2. 2. an overview of the module an overview of the module 2.1 2.1 physical components physical components the module is a single pcb, with the lcd glass mounted on the front surface and a number of components mounted on the rear. these are: the toshiba t6963c controller 2* t6a40 toshiba drivers 3* t6a39 toshiba drivers an 8 kbyte ram a number of sundry components including a main crystal (approx. 6.0 mhz) for the t6963c controller. connections to the module are made through a main 18 way 0.1 inch pin header. in addition, for backlit modules, there is an additional 2 way 0.3 inch pitch pin header which is used to carry power for the backlight. 2.2 2.2 electrical overview electrical overview the drivers (t6a40 and t6a39) are used to extend the controller's i/o to allow it to address the necessary 240 columns and 128 rows. the ram is used by the t6963c and no connections to it are available via the external connector. the ram is used to store the graphics , text and font data which decide the pixels that appear on the display. commands are available by which the user can fix how much of the total 8 kbytes of available ram space is allocated to each of these individual memory areas. more details in later sections. 2.3 2.3 settings fixed by hardware pinning in the module settings fixed by hardware pinning in the module hard-wiring on the module pcb is used to configure the controller to suit the lcd glass used. the details are given below.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 7 of 37 pin name setting meaning dual h 1 lcd screen (makes sense - there is only one lcd glass on the module) mds md0 md1 h l l 16 lines i.e. 128 vertical dots (each line is 8 dots high) md2 md3 l h 40 columns i.e. 240 horizontal dots (each column is assumed to be 6 dots wide, but see discussion in section 5) fs0 fs1 l h 6 x 8 characters (see note below) note that the fs1 input is brought out to pin 18 on the external connector but is also pulled up within the module pcb typically by a 10k resistor to vdd. the default 'logic high' that this generates selects the 6 x 8 font as the default. grounding this pin on the external connector will bring fs1 low and will therefore switch to an 8 x 8 font setting. see section 5 for a discussion of rows and columns. 2.4 2.4 pin options in the example design pin options in the example design it was decided to pull fs low to select an 8 by 8 font. this simplified the graphics line drawing routines (see section 5).
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 8 of 37 3. 3. hardware interfacing hardware interfacing 3.1 3.1 pin signal explanations pin signal explanations external connector pin external connector signal name t6963c signal name purpose / remarks 1 fg -- frame ground. this is actually the metallic frame around the lcd glass. it is not internally connected to vss. it is also not related at all to the t6963c 'frame' signal fr where 'frame' refers to a period of the lcd drive waverform. in general it makes sense to connect fg directly to vss, which is conveniently the next pin on the connector. 2 vss vss 0 volt ground for the vdd power supply 3 vdd vdd the nominal 5 volt feed to the module. needs to be held within the range 4.5 to 5.5 volts. 4 vo -- operating voltage. this is used to derive the voltage which drive the lcd glass. a negative supply is used to energise the glass is derived from the difference between vo and vdd. the optimum value of vo depends on the type of fluid in the lcd and is significantly temperature dependent. in most designs the voltage fed to vo will therefore need to be variable to allow users to set the best contrast / viewing angle at any actual operating temperature. 5 /wr /wr write enable. this is a conventional low going write signal for the data transfer bus. 6 /rd /rd read enable. this is a conventional low going read signal for the data transfer bus. 7 /ce /ce chip enable. this is a conventional low going chip enable signal for the data transfer bus. 8 c/d* c/d* control / data* selection signal. this selects whether accesses across the data bus are command / status accesses (with c/d*=high) or data accesses (with c/d*=low). 9 /rst /rst reset. this is a conventional low going reset signal. it will need to be driven low for at least 5 oscillation clock periods (i.e. at least 1.2 microseconds) after the power supplies have established. 10->17 db0->db7 db0->db7 the data bus. conventional bi-directional bus, controlled by /ce, /wr, /rd and c/d* signals.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 9 of 37 18 fs fs1 font select. note this is fs1. fs0 is not brought out to the external connector but is fixed low by wiring in the module. the fs1 signal is pulled up within the module pcb typically by a 10k resistor to vdd. the default 'logic high' that this generates selects the 6 x 8 font as the default. grounding this pin on the external connector will bring fs1 low and will therefore switch to an 8 x 8 font setting. see section 5 for a discussion of rows, columns and fonts. 3.2 3.2 typical bus systems typical bus systems the data bus used to send commands and data is conventional. the basic method of connecting the module into the address space of an mcu is illustrated as follows: figure 1: typical hardware interfacing scheme
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 10 of 37 3.3 3.3 the example design the example design the interfacing circuitry used for connecting the display module to the host microcontroller which was an hitachi h8/300h device. 3.4 3.4 wait states wait states if a fast processor is used as the host mcu it may be that the processor wait states will need to be used to give the display time to pick data from or put data onto the bus. in practice the need for wait states will typically occur when the overall processor's write cycle takes of the order of 150 nanoseconds. for details see the detailed timing in ref 1. 3.4.1 3.4.1 hardware interfacing and wait state handling in the example design hardware interfacing and wait state handling in the example design the host mcu in the example design was a member of the hitachi h8/300h family (the hd6413003rf device). the h8/300h includes on-chip address decoding logic and this was used to generate the necessary chip select signal to the module. the hd6413003rf was running at an oscillation frequency of 32 mhz (16 mhz internal) and consequently the normal read and write bus cycles would have been significantly too fast for the module to respond correctly. the hd6413003rf also includes an internal wait state controller and this was used to add a single wait state in each access to the module, so that the overall cycle times (from chip select drop to chip select raise) were then 250 nanoseconds for both read and write cycles. 3.5 3.5 operating voltage operating voltage no pixels will appear on the display unless a suitable negative operating voltage is applied to the vo pin (pin 4 on the module header). this is in contrast to many smaller display modules such as those based on the hitachi 44780 or compatible controllers, where the 5 volt supply is often sufficient to drive the lcd glass and no additional drive voltage is required. the large number of pixels of the mgl(s) implies a very high multiplex ratio (1:128), so that a higher drive voltage is needed to produce sufficient rms voltage to activate the pixels. the optimum voltage to be used varies with the type of fluid used in the display and with temperature. the temperature variations are quite marked so it is common practice to provide a potentiometer fed supply for vo so that users can themselves set the drive level to suit their preference in any operating situation. for guidance on vo ranges for types of fluid, see ref 2 which shows recommended voltages for the various differing members of the mgl(s)-240128 family. the quoted voltages are given with respect to vss, although the effective drive voltage to the lcd glass is actually vdd-vo. 3.5.1 3.5.1 operating voltage in the example design operating voltage in the example design the design example used a nominal supply voltage of -16.5 volts.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 11 of 37 3.6 3.6 recommended power up sequence recommended power up sequence it is necessary to apply the vdd supply to the module significantly before the vo supply. if this sequence is not followed a phenomenon known as 'reverse domain twist' can occur and the result can be that pixels come on when they shouldn?t. typically when this does occur, the effect is almost unnoticeable immediately after a power on when only a few such pixels may be seen but the effect gradually worsens over a few minutes. close examination shows that an affected pixel initially turns on in part (such as the top left hand corner of the pixel) only, but over the course of a few minutes the effect spreads across the whole pixel, and is unaffected by the pixel being rewritten or refreshed by the controlling software application. 3.6.1 3.6.1 power up sequencing in the example design power up sequencing in the example design in the example design the vo power supply was simply slugged to produce approximately 100 milliseconds delay after the application of the vdd supply. 4. 4. modes modes ram contents can be read and written by the application using appropriate commands and indeed writing data to the ram is the fundamental way that applications get their data onto the lcd screen. the t6963c is a little unusual in that it typically uses differing areas in the same ram space for its text, character generator look-up tables and low level graphic pixel data. the details of how the ram is interpreted by the t6963c to determine which pixels are displayed depends on the 'mode'. 4.1 4.1 what the data sheet means by 'mode' what the data sheet means by 'mode' there is some confusion in the t6963c data sheet's use of the terms 'mode' and/or 'display mode'. a clear view can be obtained by focusing on the two distinct commands involved. these are shown in the following table along with some new suggested names in addition to the corresponding t6963c data sheet names:
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 12 of 37 command word (hex) suggested name t6963c name purpose / remarks 80->8f pixel combination method mode set all commands in this range force a particular way of combining graphics and text. 90->9f display enables display mode all commands in this range force one particular combination of 'enables'. these cover the display as a whole on or off, the cursor and its type, and separate overall enables for text and graphics. 4.2 4.2 pixel combination methods pixel combination methods there are four basic ways of combining graphics, font and text data. of these, three treat the graphics data as raw pixel data and mix this with the text pixels. the remaining method is called 'text attribute' mode and here the data in the graphics area is not treated as raw pixels at all but instead sets attributes which change the appearance of the text from the text area. these four main methods are described in this table: mode comments 'or' mode the actual composite screen pixel pattern is built by logically ' or'ing the graphics and text related pixels together. this is illustrated in figure 2 below and is what might typically be used to display a graph for example, with the graphics pixels used to form the axes and the plotted curve, but the text area being used for annotating the plot with title, scales and so on. 'exor' mode here the screen pixels are determined by an 'exclusive or' function on the graphics-related and text-related pixels. this might be used to show characters in inverse i.e. white on black, by setting to '1' all the graphics pixels in the area corresponding to the text. 'and' mode here the screen pixels are determined by an ' and ' function on the graphics-related and text-related pixels. 'text attribute' mode this mode differs significantly from the others in that the data in the graphics area does not correspond to pixels at all, but is used to set attributes for the text being displayed. the attributes that can be set are various combinations of inhibit (i.e. don?t display that character), inverse (i.e. show it white on black) and flash .
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 13 of 37 4.3 4.3 pixel combination example - 'or' mode pixel combination example - 'or' mode to illustrate how the pixel combination logic operates , figure 2 shows what happens in a typical case - so called 'or' mode. in this case, what is shown in any area of the screen is a logical 'or' combination of the low level graphics pixel data for that area wit the text pixels for that area. the text pixels are determined by the character generator area contents for the text character in question. this 'or' mode would be suitable for graphics, maps, tables and other displays of mixed graphics and text. figure 2: pixel combination in 'or' mode 4.4 4.4 character generator character generator the t6963c includes a built in character generator in internal rom which can be used to generate codes for the lower half of the character map (i.e. for codes from hex 00 to hex 7f). in this character map, the characters from hex 00 to hex 5f are similar to ascii characters from hex 20 to 7f. a translation for ascii characters can therefore readily be effected by subtracting hex 20 from the ascii character values before writing them into the text area. switching between the rom character generator and the ram character generator for the lower half of the character map is done via bit 3 in the pixel combination command (in the range hex 80 to hex 8f).
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 14 of 37 note that the top half of the character map is always in ram. 4.5 4.5 limitations of the available pixel combination methods limitations of the available pixel combination methods although at first glance there appears to be plenty of flexibility for combining text and graphics to build useful practical displays, there are some significant pitfalls. remember that whichever method is selected at any one time applies to the whole display - it is therefore not possible to set, for example 'text attribute' for one part of a display and 'or' mode for the remainder. it is however possible to switch between methods at different times, to suit different display formats for example. the next sections highlight some of the points to bear in mind when choosing a mode for your display format. 4.6 4.6 limitations of 'text attribute' mode limitations of 'text attribute' mode in 'text attribute' mode there is really no effective way to exercise arbitrary control over individual pixels. in some cases this limitation can be overcome by using encoding appropriate graphic elements into any spare unused cells in the character font. an example here would be a set of line and corner elements for displaying boxes around text. note that this approach does have limitations - each element must for example, be a whole number of character cells in size. in this mode all the text must be shown in the same font, and differing fonts cannot be mixed in one display format. again there is a work around here in that unused cells in the character map can be loaded with patterns which can be used to show or build other sized characters. as an example 10 otherwise unused character cells could be used to show the characters '0' to '9' in a smaller font, suitable, say, for subscripts. note however that this approach is again limited because the smaller characters are still embedded in the full size character space and therefore cannot be displayed closer together than the normal size characters. 4.7 4.7 limitations of graphics based modes limitations of graphics based modes in the three methods which treat the graphics data as true pixel data (i.e. 'and', 'exor' and 'or' modes), it is not possible to invoke text attributes. inverse, or flashing text cannot therefore be generated automatically. some attributes can be implemented by suitable low level actions (e.g. regularly re-writing flashing text alternately as blanks), but this will inevitably have an overhead in the application software and you will need to consider this carefully in your design. 4.8 4.8 limitations of all characters displayed from the text area limitations of all characters displayed from the text area every character displayed using the character generator to translate characters from the text area will be aligned on the standard row and column grid. this can be inconvenient particularly in display formats which try to get a lot of information on the screen at once. when labelling the axes of a graph, for example, the text needs ideally to be placed a pixel or two away from the axis to give a tidy result, but the column and row grid may not allow this. 4.9 4.9 choosing a pixel combination method choosing a pixel combination method if your display requires arbitrary single pixels or groups of pixels, you will probably need to use 'or' mode and implement any special attributes yourself by low level actions in your application.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 15 of 37 if you need general text in several font sizes, again you will probably need to use 'or' mode so that you can have your application write the non-standard size characters by building them up from their individual constituent pixels. if you need to place text characters anywhere other than on the fixed rows and columns you will also probably need to use 'or' mode, and write the characters by building them up with pixels. in summary, it would appear that most practical formats will need to use 'or' mode and will need to build up from low level pixels, any characters which are non-standard sizes or that need to be positioned anywhere other than on the standard row and column grid. 4.9.1 4.9.1 the pixel combination method chosen for the example design the pixel combination method chosen for the example design the need to get the maximum information on the display in an attractive form, dictated that various sized fonts where needed and that many characters needed to be placed off- grid. in addition several formats needed to show graphs and many needed boxes around text items. all these considerations meant that 'or' mode was the only sensible choice. in fact it was decided that the need to be able to place even some of the standard size characters off-grid, meant that even these would have to be built up by low level pixel writes, so this low level approach was used for every character in every format. the text area and its associated character generator area was therefore never used and text was never enabled. 5. 5. memory overview memory overview the module has 8 k bytes of ram fitted, so valid addresses range from hex 0 to hex 1fff. 5.1 5.1 text area text area if the 8 by 8 font is selected, then there are 30 characters across the screen and to cover the whole display the text area size must therefore be: 30 * 16 = 480 bytes (hex 01e0) in 6 by 8 font situations, there are 40 columns so the allocations become: 40 * 16 = 640 bytes (hex 0280) 5.2 5.2 graphics area graphics area if the 8 by 8 font is selected, then in the three true graphics modes, each bit controls 8 pixels so each row of pixels requires 30 bytes. to cover the whole display the graphics area size must therefore be: 30 * 128 = 3840 bytes (hex 0f00) in 6 by 8 font situations, each graphics byte covers only 6 pixels, so 40 bytes are needed to cover each row, and the corresponding allocations for the whole display must be:
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 16 of 37 40 * 128 = 5120 bytes (hex 1400) note that in text attribute mode, each byte defines the attributes for a complete character, just as each byte in the text area maps to a complete character. the graphics area allocations in text attribute mode are therefore identical to the text area allocations and are significantly smaller than in the three true graphics modes. 5.3 5.3 font area font area the ram area needed to define a character in the font map doesn?t depend on whether the font selected is the 6 by 8 or the 8 by 8 - unused bits simply become 'don?t cares'. if the internal rom character generator is used then the effective maximum size of the character generator ram will be the 128 character codes from hex 80-hex ff: 8 * 128 = 1024 bytes (hex 400) if the internal character generator is not enabled then the maximum size of the character generator ram will rise to: 8 * 256 = 2048 bytes (hex 800) the internal rom character generator is enabled or disabled by the state of bit 3 in the pixel combination method setting command (in the range hex 80 to hex 8f). 5.4 5.4 suggested memory map suggested memory map the 8 k bytes provided are sufficient to allow the maximum allocations for all these areas and a suggested usage is therefore as follows: figure 3: suggested memory allocations
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 17 of 37 5.5 5.5 ram implications of column configurations ram implications of column configurations the t6963c data sheet refers to three differing ways in which the number of columns can be configured: pin-programmable. via the md2 and md3 pins (fixed in the module to 40 columns) text area columns setting via the text area set command (hex 41) graphics area columns setting via the graphics area set command (hex 43) the detailed functions of these various settings are discussed in the sections which follows. 5.6 5.6 pin programmable columns pin programmable columns the data sheet is not specific about exactly what the hardware programming set by md2 and md3 determines. one might have expected that it would set the number of character cells across the screen, and in this case, it would be expected that switching font widths might alter the effective number of horizontal pixels driven, because for example 40 columns of 8 pixels wide characters corresponds to 320 horizontal pixels, whereas 40 columns of 6 pixels corresponds to 240 pixels. in practice changing the font width setting does not appear to affect the level of drive to each pixel or the number of pixels driven, and this would suggest that the drive signals are unaffected. it would therefore appear that the hardware column settings simply tell the controller how wide the display is, assuming 6 pixel wide columns regardless of the actual selected font setting. in the case of the mgl(s) 240128 the pin-programmable column setting is fixed at 40 and there are 6 times as many (240) horizontal pixels so this appears to make sense. trident may be able to clarify here. 5.7 5.7 text area column setting text area column setting the parameter set by this command tells the t6963c how much to add to any text ram address to get to the corresponding address for the next row. it therefore fixes the separation in text ram between consecutive rows on the lcd. rather oddly, it doesn?t actually fix the length of rows themselves which remain at the full display width, and this can result in characters being repeated on the display in multiple positions. taking a relatively extreme example to illustrate this, assume that this 'text area columns parameter' is set to 4 columns. writing the character 'a', to the first text address (i.e. the text home) will cause an 'a' to appear at the top left hand corner of the lcd: a
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 18 of 37 writing 'b', 'c' and 'd' to the next three bytes respectively will add these to the display: abcd this is very much as expected. however if we now write 'e' to the next address, it will be shown on the lcd twice. this is because the text column parameter setting is now '4' and the 'e' is 4 bytes on from the start of the first line, so the 'e' is now regarded as the first character of the next line, and it therefore appears under the 'a'. because the column setting doesn?t actually shorten the length of the rows it will also appear on the first row after the 'd': abcde e it we continue to write characters to consecutive addresses in this way, 'i' will then appear as the first character on the third row, as well as the 5 th character on the second row and the 9 th character on the first row: abdcefghi efghi i although it is conceivable this slightly curious behaviour might have some value in some applications in the vast majority it doesn?t and the only sensible values to set are 40 for 6 dot wide font and 30 for the 8 dot wide font. these settings will give a clear, efficient mapping between text ram addresses and lcd character cells. 5.8 5.8 graphics area column setting graphics area column setting this is very similar to the text column setting parameter described above, but instead of setting the ram separation of consecutive rows of characters , it sets the ram separation of consecutive rows of graphics pixels. like the text columns parameter it also does not fix the length of the rows, so setting a value shorter than 40 (for 6 dot wide fonts) or 30 for 8 dot wide fonts will result in repeated pixels. taking a similar example to that above where the graphics column setting is 4, and writing 5 bytes of data starting at the graphics home address, would affect the display as shown. for clarity the fifth byte is chosen to be all ones with all the others all zeroes:
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 19 of 37 just as for the text columns, the upshot of all this is again that it only makes sense to select 40 columns for 6 dot wide fonts and 30 columns for 8 dot wide fonts. 5.9 5.9 ram implications of font selections ram implications of font selections the fs signal on the external connector allows control of the fs1 input to the t6963c. pulling this low sets an 8 dot wide font, leaving it high sets a 6 dot wide font. these settings basically fix the number of horizontal pixels that each byte of the text area or graphics area control. note that this fixes the display width of graphics bytes as well as text bytes. this means that when an 8 dot wide font is selected each bit in each graphics area byte influences one pixel and when a 6 dot wide font is selected only the lower 6 bits influence the display and the top two bits have no effect. this is illustrated in the two diagrams which follow. the first shows the situation corresponding to an 8 dot wide font (i.e. fs=low) and the second shows how this changes when fs is left pulled high. in these examples it is assumed that the number of graphics columns has been set to 240 divided by the font width, so there is no premature wrapping to the next line. 5.10 5.10 graphic bits to pixel mapping when 8 by 8 font selected graphic bits to pixel mapping when 8 by 8 font selected figure 4: graphic bits to pixel mapping - 8 by 8 font
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 20 of 37 5.11 5.11 graphic bits to pixel mapping when 6 by 8 font selected graphic bits to pixel mapping when 6 by 8 font selected figure 5: graphic bits to pixel mapping - 6 by 8 font 5.12 5.12 memory, columns and font summary memory, columns and font summary in this module the hardware column programmable column pins are fixed at the equivalent of 240 horizontal dots and all 240 pixels are therefore always driven. the 'graphics columns' and 'text columns' setting which can be set by commands define the separation in ram between the start address of the graphics and text rows respectively. the 'graphics columns' and 'text columns' settings don?t alter the length of the rows so with some settings bytes in the ram can be multiply mapped to lcd areas. it really only makes sense to set these 'graphics columns' and 'text columns' to the same value, and this value should be 30 when using an 8 by 8 font and 40 when using the 6 by 8 font. the font width changes how many horizontal pixels are affected by any byte in graphics or text ram. when set to 8 by 8 font each byte in ram governs an area 8 bits wide, the 6 by 8 font means each ram byte governs an area 6 bits wide. when a 6 by 8 font is selected the top two bits of each graphics byte are don?t cares.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 21 of 37 the first byte in the text area governs the character shown at the top left, the next byte governs the next character to the right and so on until the position wraps on to the start of the next line. similarly the first byte in the graphics area governs the pixels shown in the top pixel row at the top left, the next byte governs the next set of 6 or 8 pixels to the right and so on until the position wraps on to the start of the next pixel row. 5.13 5.13 memory, column and font settings in the example design memory, column and font settings in the example design it was decided to use a columns parameter of 30 for graphics. along with the selected 8 by 8 font, this gave the clearest logical mapping between graphics area bits and screen pixels. (the text columns were also set to 30 for completeness, but strictly this was unnecessary as the text area was unused). the memory map selected was as described above. the parameters sent were therefore: graphics home address hex 0000 graphics area set hex 1e (decimal 30) text home address hex 1400 text area set hex 1e (decimal 30) offset register hex 03 (sets cg start address = hex 17ff) 6. 6. command overview command overview th descriptions in reference 1 of the various commands that are available are relatively clear, and consequently what is presented here is a little additional explanatory information. 6.1 6.1 commands and data commands and data writes to the device with the c/d* line high are treated as commands and writes to the t6963c with the c/d line low are treated as data. typically the c/d* line will be wired as the lest significant address line in the system and consequently the t6963c will appear to occupy two consecutive addresses in the host systems memory map. the lower address will form a command register and the upper address will form a data register.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 22 of 37 6.2 6.2 status checking status checking reads from the command/status address will return a byte which can be interpreted as follows: msb lsb 1=pixels are being shown 0=blinking pixels are off 1=error when using screen peek/copy 0=ok 1=overall controller ready 0=not ready not used 1=ready to receive next auto mode data byte 0=not ready 1=ready to receive next auto mode command 0=not ready 1=ready to receive next non- auto mode data byte 0=not ready 1=ready to receive next non- auto mode command byte 0=not ready 6.3 6.3 differing status checks for auto / normal mode differing status checks for auto / normal mode for normal (i.e. non auto) commands the bottom two bits indicate if the t6963c is ready to accept a new byte. when in auto mode the bottom two bits do not correctly indicate the status and the next two bits must be checked instead. note that the 'set auto mode' commands (hex b0 'auto mode write set' and hex b1 ' auto mode read set') are sent to turn on auto mode when it is off and consequently it is the normal status bit pair that must be checked before sending either of these commands. similarly the 'auto mode reset' command hex b2 is sent to turn off auto mode when it is on and therefore it is the auto mode bit pair that must be checked prior to sending this command. 6.4 6.4 command and data write order command and data write order where a command expects data, this should be written to the module first, before the command is written. 6.5 6.5 word write order word write order some commands take two bytes of data and where this is the case, two bytes need to be sent before the command. the first byte sent is the least significant byte and the second is the most significant.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 23 of 37 6.6 6.6 command set summary command set summary a reference table of commands is given as appendix c. 7. 7. hints and tips hints and tips 7.1 7.1 usage checklist usage checklist the checklists given here may help if you have trouble getting the module up and running originally. 7.2 7.2 hardware action checklist hardware action checklist to use the module you will need to connect a +5 volt feed between vdd and vss and a larger negative operating voltage (e.g. - 16.5 volts) feed to vo. the sequence in which these are applied is important - see section 3. you will also need to generate a low going reset pulse which must be held active until after the power has stabilised. you will also need to be able to send commands and data to the device across a conventional 8 bit bi-directional data bus. by sending appropriate command and data sequences you will then be able to manipulate the pixels that are shown in the display by writing to the ram. 7.3 7.3 software action checklist software action checklist for your application to get the desired pattern of pixels on the display it will typically need to: set a pixel combination method (by sending a command in the range hex 80 to hex 8f). see notes in section 4. set an appropriate combination of enables (by sending a command in the range hex 90 to hex 9f). see notes in section 4. set the start address of the ram area to be used for the character generator, by sending the 'set offset register' command hex 22 with appropriate data. see notes in section 5. write any necessary character patterns into the character generator area of the ram. ram writes are done by first issuing an 'address register set' command (hex 24) to force the internal address pointer to the address of the ram byte to be written. the data can then be written to this address by a suitable data write command. whenever more than one byte is to be written it makes sense to use the auto write facility in which data bytes can be simply sent consecutively and in which automatically increments or decrements the address after each byte ready for the next. set the text home address, the text area column count, the graphic home address and the graphic area column count. this will require 4 separate commands (hex 40, hex 41, hex 42 and hex 43 respectively) with appropriate associated data.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 24 of 37 write the text to be displayed into the text area of the ram. write the graphics data to be displayed into the graphics area of the ram. 7.4 7.4 the action sequence in the example design the action sequence in the example design the sequence of actions carried out was as given below. remember that in the example design the fs line was pulled low to give an 8 by 8 font. apply vdd delay . . apply vo delay to allow power supplied to stabilise ? drive / rst low wait 10 milliseconds . . drive / rst line high again check status register /* simple diagnostic check - should be hex 23 after reset */ set graphics home address to 0000 set text home address to hex 1400 set graphics area to hex 1e (dec.30) set text area to hex 1e (dec.30) set 'or' mode set offset register to 3 (set cg address to hex 17ff) set ensables blank all text ram blank all graphics ram . . progress to normal application - write sign on bit map logo / banner etc.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 25 of 37 7.5 7.5 troubleshooting basics / check list troubleshooting basics / check list symptom suggestion / remarks no pixels ever appear on the display at all. even if no commands are ver sent correctly it is quite common to see at least a momentary horizontal line of pixels on the display when power is first applied. if you never see even this it is probably a good idea to check the power connections carefully. check that the correct power supply voltages are being fed to the module (if possible measure them on the 18 way header on the module itself). in particular check that you are feeding the correct negative bias voltage on to the vo pin. check that the /rst line is correctly driven low after the power supplies have stabilised, and that it does return high again a short while later. check that there are pulses on the /ce and /wr lines when your application software attempts to access the module. check that you have correct control of the c/d* line. if it is connected to a0 you will normally see this changing state as your application code uses the address bus. if possible check that the bus access signals are not too fast for the module. check them against the timing diagrams and specifications given in ref. 1. after power up some pixels erroneously appear to come on gradually over the course of a few minutes. check that you are following the recommendations for power supply sequencing given in section 3 above. text related pixels appear but no graphics related pixels appear. check that you are enabling text i.e. that bit 2 is set in your 'force display enables' command. check that you have set the correct start address for the text area, and that you are correctly writing the text into this area. you might find it useful to try temporarily using 'read' commands to verify that the data is getting into the ram as expected. check that you have set the correct pixel combination method (using a command in the range 80-8f). in particular if you have set 'and' mode you will only get pixels where both text and graphics data show the pixel should be on. if the graphics data is all zeros, no text pixels will therefore appear.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 26 of 37 if any of the text appears to flash this suggests that you have set text attribute mode in which graphics pixels are not shown on the display, but instead modify the display of the text. graphics related pixels appear but no text related appears. check that you are enabling graphics i.e. that bit 3 is set in your 'force display enables' command. check that you have set the correct start address for the graphics area, and that you are correctly writing your graphics pixel bytes into this area. again you might find it useful to try temporarily using 'read' commands to verify that the data is getting into the ram as expected. check that you have set the correct pixel combination method (using a command in the range 80-8f). in particular if you have set 'and' mode you will only get pixels where both text and graphics data show the pixel should be on. if there is no text, no graphics pixels will appear. text appears to wrap around the display too early or appears in several places on the display simultaneously. check that you have set the 'text columns' correctly using the command hex 41 along with the correct number of columns. graphics data appears to wrap around the display too early or appears in several places on the display simultaneously. check that you have set the 'graphics columns' correctly using the command hex 43 along with the correct number of columns. the characters that appear on the display are not correct. check that you are using the correct character generator option. (set by the state of bit 3 in your pixel combination method setting command (hex 80-8f ) ). also check that you are correctly setting the offset register to show the start of the character generator ram area, and that you are loading any necessary character patterns into the character generator area you select. remember that the internal character generator values are offset from standard ascii values. 7.5.1 7.5.1 troubleshooting the example design troubleshooting the example design when initially debugging the example design, the need for the vo supply wasn?t spotted and some time was spent trying to find a reason as to why no pixels appeared at all. initially the power supplies were applied together and consequently the display did suffer from the 'reverse domain twist' effect in which some pixels came on erroneously of their own accord over the first few minutes of running.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 27 of 37 8. 8. using other modules using other modules this section is currently awaiting any information from trident on other modules. 8.1 8.1 module xxxxx module xxxxx 8.1.1 8.1.1 memory map memory map 8.1.2 8.1.2 notes notes 8.2 8.2 module xxxxx module xxxxx 8.2.1 8.2.1 memory map memory map 8.2.2. 8.2.2. notes notes *** end of document body ***
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 28 of 37 appendix a - sample pc interfacing circuitry appendix a - sample pc interfacing circuitry circuit schematic based on a low-cost proprietary pc parallel i/o card to be used to exercise and evaluate the display module.
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 29 of 37 appendix b - trial 'c' code appendix b - trial 'c' code file: lcdeval.c file: lcdeval.c /****************************************************************************** file : lcdeval.c date : 10.7.1997 auth : nigel laming / john thorn (asl) this source code is designed to exercise simply the lcd graphics module mgl(s)-240128t, via a low cost proprietary pc parallel i/o code. it was compiled and linked to a simple dos ' .exe.', using microsoft visual c vn 1.5 *******************************************************************************/ /****************************************************************************** interface to the mgl(s)-240128t lcd graphic module implemented via the mps am11m card - see hardware schematic. lcd 8255 (base address 0x278) * wr pb0 * rd pb1 * ce pb2 c/d pb3 * rst pb4 d7 pa7 + pc7 d6 pa6 + pc6 d5 pa5 + pc5 d4 pa4 + pc4 d3 pa3 + pc3 d2 pa2 + pc2 d1 pa1 + pc1 d0 pa0 + pc0 ******************************************************************************** # include " stdio.h" # include " conio.h" # include " lcdeval.h" byte uccontrolportcopy; /* simple copy of control port */ byte guchardware; /* used to show if hardware correctly present */ /******************************************************************************** low level interfacing routines these provide the low level interface to the mgl(s)-240128, via the mps parallel i/o card. *********************************************************************************/ void graphiclcdmakedataoutput ( ) { } void graphiclcdmakedatainput ( ) { cardoutput (lcddataoutport, oxff); } void graphiclcdmakeallconthigh ( ) { uccontrolportcopy = 0x00 uccontrolportcopy = lcd_cd+lcd_ce+lcd_rd+lcd_wr; cardoutput (lcdcontport, uccontrolportcopy); } void graphiclcdlowerreset ( ) { uccontrolportcopy = 0x00 uccontrolportcopy = lcd_cd+lcd_ce+lcd_rd+lcd_wr; cardoutput (lcdcontport, uccontrolportcopy); } void graphiclcdraisereset ( ) { uccontrolportcopy = lcd_rst; cardoutput (lcdcontport, uccontrolportcopy); } void graphiclcdlowercontdata ( ) { uccontrolportcopy &= ~lcd_cd; cardoutput (lcdcontport, uccontrolportcopy); } void graphiclcdriasecontdata ( ) { uccontrolportcopy = lcd_cd; cardoutput (lcdcontport, uccontrolportcopy); }
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 30 of 37 void graphiclcdlowerenable ( ) { uccontrolportcopy &= ~lcd_ce; cardoutput (lcdcontport, uccontrolportcopy); } void graphiclcdraiseenable ( ) { uccontrolportcopy = lcd_ce; } void graphiclcdlowerread ( ) { uccontrolportcopy &=lcd_rd; cardoutput (lcdcontport, uccontrolportcopy); } voidgraphiclcdriaseread ( ) { uccontrolportcopy = lcd_rd; cardoutput (lcdcontport, uccontrolportcopy); } void graphiclcdlowerwrite ( ) { uccontrolportcopy &= ~lcd_wr; cardoutput (lcdcontport, uccontrolportcopy); } void graphiclcdriasewrite ( ) { uccontrolportcopy = lcd_wr; cardoutput (lcdcontport, uccontrolportcopy); } byte graphiclcdreaddataport ( ) { return inp (lcddatainport); } void graphiclcdoutputdataport (byte ucbyte) { cardoutput (lcddataoutport, ucbyte); } void graphiclcdinit ( ) { int i; int j; byte status; /* set up the pio */ cardoutput (lcdmodeport, bit7+bit4); /* port a output */ graphiclcdlowerreset ( ); graphiclcdmakeallconthigh ( ); for (i=0; i<10000; i++) { j++; } graphiclcdriasereset ( ); status = graphiclcdgetstatus ( ); guchardware = 1; if ( status != 0x23) { /* we have not got the lcd connected so don?t attempt talking to it */ guchardware = 0; } /* graphic home addr 0000h */ graphiclcdsenddtaword (c_lcd_graphic_home_addr); graphiclcdsendcmd (lcd_cmd_grhom); /* text home addr 1400h */ graphiclcdsenddtword (c_lcd_text_home_addr); graphiclcdsendcmd (lcd_cmd_txhome); /* text area set 30 columns */ graphiclcdsenddtaword (30); graphiclcdsendcmd (lcd_cmd_txarea); /* graphic area set 30 columns */ graphiclcdsenddta word ((30); graphiclcdsendcmd (lcd_cmd_grarea); /* mode set - or mode * / graphiclcdsendcmd (lcd_cmd_or_mode); /* offset */ graphiclcdsenddtaword (0x0003); graphiclcdsendcmd (lcd_cmd_offset); /* display mode - text on, graphics on, cursor off */ graphiclcdsendcmd (0x9f); /* text blank */ graphiclcdsenddtaword (c_lcd_text_home_addr);
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 31 of 37 graphiclcdsendcmd (lcd_cmd_adpset); graphiclcdsendcmd (lcd_cmd_awron); for (i= 0; i<480; i++) { graphiclcdsendautobyte ('\x00'); } graphiclcdsendcmd (lcd_cmd_awroff); graphiclcdsenddtaword (c_lcd_graphic_home_addr); graphiclcdsendcmd (lcd_cmd_adpset); graphiclcdsendcmd (lcd_cmd_awron); for (i=0; i<3840; i ++) { graphiclcdsendautobyte ('\x00') } graphiclcdsendcmd (lcd_cmd_awroff); } byte graphiclcdgetdatabyte (void) { byte ucbyte; if ( guchardware) } while (! graphiclcdmoduleready ( ) ) { } /* make data bus inputs */ graphiclcdmakedatainput (); graphiclcdlowercontdata (); graphiclcdlowerenable (); graphiclcdraisewrite (); graphiclcdlowerread (); ucbyte = graphiclcdreaddataport (); graphiclcdraiseread (); graphiclcdraiseenable (); } return ucbyte; } byte graphiclcdgetstatus () { byte status; /* make data bus inputs */ graphiclcdmakedatainput (); graphiclcdriasecontdata (); graphiclcdlowerenable (); graphiclcdraisewrite (); graphiclcdlowerread (); status = graphiclcdreaddataport (); graphiclcdraiseread (); graphiclcdriaseenable (); return status ; } bool graphiclcdmoduleready ( ) { byte status; if ( guchardware) {/* make data bus inputs */ graphiclcdmakedatainput ( ); graphiclcdraisecontdata ( ); graphiclcdlowerenable ( ); graphiclcdraisewrite ( ); graphiclcdlowerread ( ); status = graphiclcdreaddataport ( ); graphiclcdraiseread ( ); graphiclcdraiseenable ( ); if ( (status & 0x03) == 0x03) } return 1 ; } else { return 1; } return 0; } bool graphiclcdautoready ( ) { byte status; if ( guchardware) { /* make data bus inputs */ graphiclcdmakedatainput ( ); graphiclcdraisecontdata ( ); graphiclcdlowerenable ( ); graphiclcdraisewrite ( ); graphiclcdlowerread ( ); status = graphiclcdreaddataport ( ); graphiclcdraiseread ( ); graphiclcdraiseenable ( ); if ( (status & 0x08) == 0x08) {
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 32 of 37 return 1; } } else { return 1; } return 0; } void graphiclcdsenddtaword (word wdata) { if ( guchardware) { graphiclcdsenddtabyte (( wdata & 0xff); /* lsbyte first */ graphiclcdsenddtabyte (( wdata >> 8) & 0xff); } } void graphiclcdsenddtabyte (byte ucbyte) { if ( guchardware) { while (! graphiclcdmoduleready ()) { } graphiclcdmakedataoutput (); graphiclcdlowercontdata (); graphiclcdlowerenable (); graphiclcdlowerwrite (); graphiclcdoutputdataport ( ucbyte); graphiclcdraisewrite (); graphiclcdraiseenable (); } } void graphiclcdsendautobyte (byte ucbyte) { if ( guchardware) { while (! graohlcdautoready ()) { } graphiclcdmakedataoutput (); graphiclcdlowercontdata (); graphiclcdlowerenable (); graphiclcdlowerwrite (); graphiclcdoutputdataport ( ucbyte); graphiclcdraisewrite (); graphiclcdraiseenable (); } } void graphiclcdsendcmd (byte ucbyte) { if ( guchardware) { while (! graphiclcdmoduleready ()) { } graphiclcdmakedataoutput (); graphiclcdraisecontdata (); graphiclcdlowerenable (): graphiclcdlowerwrite (); graphiclcdoutputdataport ( ucbyte); graphiclcdraisewrite (); graphiclcdraiseenable (); } } void cardoutput (word waddr, byte ucbyte) { outp ( waddr, ucbyte) ; } /********************************************************************************* main () this is the main function of the evaluation code. it sets or mode, and writes some example text and surrounds it by a box. the text is written in the text area, and the box is written to the graphics area or mode combines them onto the screen. the result looks a little like this :- _______________________ | | | and software ltd | |______________________ | n.b. assumes fs signal pulled low on module. ********************************************************************************/ int main ( int argc, char * argc [ ], char * envp [ ] ) { int i; /* reset the lcd module and set it up */ graphiclcdinit (); /************************************************** text char write
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 33 of 37 now write the text characters by :- setting the address pointer setting auto mode write sending the characters one after another *****************************************************************/ /* start writing the 2 rows down, 6 in (2 * 30) + 6 */ graphiclcdsenddtaword (c_lcd_text_home_addr+66); graphiclcdsendcmd (lcd_cmd_adpset); graphiclcdsendcmd (lcd_cmd_awron); graphiclcdsenddtabyte ('a'- 0x20); graphiclcdsenddtabyte ('n'- 0x20); graphiclcdsenddtabyte ('d'- 0x20); graphiclcdsenddtabyte (' '- 0x20); graphiclcdsenddtabyte ('s'- 0x20); graphiclcdsenddtabyte ('o'- 0x20); graphiclcdsenddtabyte ('f'- 0x20); graphiclcdsenddtabyte ('t' - 0x20); graphiclcdsenddtabyte ('w'- 0x20); graphiclcdsenddtabyte ('a'- 0x20); graphiclcdsenddtabyte ('r'- 0x20); graphiclcdsenddtabyte ('e'- 0x20); graphiclcdsenddtabyte (' '- 0x20); graphiclcdsenddtabyte ('l'- 0x20); graphiclcdsenddtabyte ('t'- 0x20); graphiclcdsenddtabyte ('d'- 0x20); graphiclcdsenddtabyte ('.'- 0x20); graphiclcdsendcmd (lcd_cmd_awrff); /****************************************************************** graphics box write now write the text characters by :- setting the address pointer setting auto mode write sending the characters one after another ************ ******************************************************/ /* top most horizontal line */ /* start writing the 10 dots rows down,5 in (10 * 30)+ 5 */ graphiclcdsenddtaword (c_lcd_graphic_home_addr+305); graphiclcdsendcmd (lcd_cmd_adpset); graphiclcdsendcmd (lcd_cmd_awron); for ( i = 0; i < 19; i ++) { graphiclcdsendautobyte (' \xff'); } graphiclcdsendcmd (lcd_cmd_awroff); /* bottom most horizontal line */ /* start writing the 30 dots rows down, 5 in (30 * 30) + 5 */ graphiclcdsenddtaword (c_lcd_graphic_home_addr+905); graphiclcdsendcmd (lcd_cmd_adpset); graphiclcdsendcmd (lcd_cmd_awron); for ( i =0; i < 19; i ++) { graphiclcdsendautobyte (' \xff'); } graphiclcdsendcmd (lcd_cmd_awroff); /* left most vertical line */ /* start writing the 11 dots rows down, 5 in (11 * 30) + 5 */ for ( i = 0; i < 19; i ++) { graphiclcdsenddtaword (c_lcd_graphic_home_addr+((11+i)*30)+5); graphiclcdsendcmd (lcd_cmd_aspset); graphiclcdsenddtabyte ('\x80'); /* left most pixel */ graphiclcdsendcmd (lcd_cmd_write); } /* right most vertical line */ /* start writing the 11 dots rows down, 5 in (11 * 30) + 23 */ for ( i =0; i < 19; i ++) { graphiclcdsenddtaword (c_lcd_graphic_home_addr+ ((11+i) *30)+23); graphiclcdsendcmd (lcd_cmd_adpset); graphiclcdsenddtabyte ('\x01'); /* right most pixel */ } return 1; } /************************************************************************* end of file : lcdeval.c *************************************************************************/
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 34 of 37 file : lcdeval.h /*********************************************************************** file : lcdeval.c date : 10.7.1997 auth : nigel laming / john thorn (asl) ************************************************************************/ # infndef graphlcd_h # define graphlcd_h # define bool unsigned char # define byte unsigned char # define word unsigned int # define bit8 0x80 # define bit6 0x40 # define bit5 0x20 # define bit4 0x10 # define bit3 0x08 # define bit2 0x04 # define bit1 0x02 # define bit0 0x01 # define lcddatainport 0x278 # define lcdcontport 0x279 # define lcddataoutport 0x27a # define lcdmodeport 0x27b # define lcd_rst bit4 # define lcd_cd bit3 # define lcd_ce bit2 # define lcd_rd bit1 # define lcd_wr bit0 # define lcd_status_condition_blink bit7 # define lcd_status_error_flag bit6 # define lcd_status_capab_ctr bit5 # define lcd_status_not_used bit4 # define lcd_status_auto_mode_data_write bit3 # define lcd_status_auto_mode_data_read bit2 # define lcd_status_capab_dta bit1 # define lcd_status_capab_cmd bit0 /* see t6963 p144 for more details */ # define lcd_cmd_txhome 0x40 # define lcd_cmd_txarea 0x41 # define lcd_cmd_grhome 0x42 # define lcd_cmd_grarea 0x43 # define lcd_cmd_offset 0x22 # define lcd_cmd_adpset 0x2 4 # define lcd_cmd_or_mode 0x80 # define lcd_cmd_disp_mode 0x94 # define lcd_cmd_awron 0xb0 # define lcd_cmd_awroff 0xb2 # define lcd_cmd_screen_peek 0xe0 # define lcd_cmd_bit_clr 0xf0 # define lcd_cmd_bit_set 0xf8 # define c-lcd_graphic_home_addr (0x0000) # define c_lcd_text_home_addr (0x1400) # define lcd_cmd_write_inc 0xc0 # define lcd_cmd_read_inc 0xc1 # define lcd-cmd_write_dec 0xc2 # define lcd-cmd_read_dec 0xc3 # define lcd_cmd_write 0xc4 # define lcd_cmd_read 0xc5 # define lcd_line_style_none 0x00 # define lcd_line_style_normal 0x01 # define lcd_line_style_dotted 0x02 # define lcd_line_style_clear 0x03 # define lcd_line_style_dotted_xor 0x04 # define lcd_line_style_solid_xor 0x05 # define lcd_font_6x8 0x00 # define lcd_font_9x14 0x01 # define lcd_font_9x14 0x02 # define lcd_attr_normal 0x00 # define lcd_attr_inverse 0x01 # define pdl_state_await_cmd 0x00 # define pdl_state_await_para 0x01 extern void graphiclcdmakedataoutput (void) ; extern void graphiclcdmakedatainput (void) ; extern void graphiclcdmakeallconthigh (void) ; extern void graphiclcdlowerreset (void) ; extern void graphiclcdraisereset (void) ;
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 35 of 37 extern void graphiclcdlowercontdata (void) ; extern void graphiclcdraisecontdata (void) ; extern void graphiclcdlowerenable (void) ; extern void graphiclcdraiseenable (void) ; extern void graphiclcdlowerread (void) ; extern void graphiclcdraiseread (void) ; extern void graphiclcdlowerwrite (void) ; extern void graphiclcdraisewrite (void) ; extern byte graphiclcdreaddataport (void) ; extern void graphiclcdoutputdataport (byte) ; extern void graphiclcdinit (void) ; extern byte graphiclcdgetdatabyte (void) ; extern byte graphiclcdgetstatus (void) ; extern bool graphiclcdmoduleready (void) ; extern bool graphiclcdautoready (void) ; extern void graphiclcdsenddtaword (word) ; extern void graphiclcdsenddtabyte (byte) ; extern void graphiclcdsendautobyte (byte) ; extern void graphiclcdsendcmd (byte) ; extern void cardoutput (word, byte) ; extern unsigned char gucx; extern unsigned char gucy; # endif /************************************************************************** end of file : lcdeval.h **************************************************************************/
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 36 of 37 appendix c ? command list appendix c ? command list command (hex) first data byte second data byte purpose/remarks 21 x address y address cursor pointer set 22 top 5 bits of character generator base address n/a offset register set 24 low byte of the address high byte of the address address pointer set 40 low byte of the address high byte of the address text home address set 41 columns n/a text area set 42 low byte of the address high byte of the address graphics home address set 43 columns n/a graphics area set 80 n/a n/a 'or' mode with rom cg on set 81 n/a n/a 'exor' mode with rom cg on set 82 n/a n/a 'and' mode with rom cg on set 83 n/a n/a 'text attribute' mode with rom cg on set 88 n/a n/a 'or' mode with rom cg off set 89 n/a n/a 'exor' mode with rom cg off set 8a n/a n/a 'and' mode with rom cg off set 8b n/a n/a 'text attribute' mode with rom cg off set 90 n/a n/a display disabled 91 n/a n/a text off, graphics off, no cursor. 92 n/a n/a text off, graphics off, steady cursor. 93 n/a n/a text off, graphics off, blinking cursor. 94 n/a n/a text on, graphics off, no cursor. 95 n/a n/a text on, graphics off, no cursor. 96 n/a n/a text on, graphics off, steady cursor. 97 n/a n/a text on, graphics off, blinking cursor. 98 n/a n/a text off, graphics on, no cursor. 99 n/a n/a text off, graphics on, no cursor. 9a n/a n/a text off, graphics on, steady cursor
application note an1631 mgl(s) 240128 display july 2001 _____________________________________________________________________________________ __________________________________ _______________________________________________________________________________________________________________________ ? and software ltd page 37 of 37 9b n/a n/a text off, graphics on, blinking cursor. 9c n/a n/a text on, graphics on, no cursor. 9d n/a n/a text on, graphics on, no cursor. 9e n/a n/a text on, graphics on, steady cursor. 9f n/a n/a text on, graphics on, blinking cursor. a0 n/a n/a set cursor as 1 line. a1 n/a n/a set cursor as 2 lines. a2 n/a n/a set cursor as 3 lines. a3 n/a n/a set cursor as 4 lines. a4 n/a n/a set cursor as 5 lines. a5 n/a n/a set cursor as 6 lines. a6 n/a n/a set cursor as 7 lines. a7 n/a n/a set cursor as 8 lines. b0 n/a n/a set auto write mode. b1 n/a n/a set auto read mode. b2 n/a n/a set non-auto mode. i.e. cancel auto read and/or auto write mode. c0 data n/a write data and increment address pointer. c1 n/a n/a read data and increment address pointer. c2 data n/a write data and decrement address pointer. c3 n/a n/a read data and increment address pointer. c4 data n/a write data but don't change address pointer. c5 n/a n/a read data but don't change address pointer. e0 n/a n/a screen peek e8 n/a n/a screen copy f0>f7 n/a n/a bit 0 clear to bit 7 clear f8>ff n/a n/a bit 0 set to bit 7 set ***end of document***


▲Up To Search▲   

 
Price & Availability of MGLS-240182

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X